import React from "react";
import { ResultPage, Card, Switch } from "antd-mobile";
import styles from "./index.module.css";
import { Exchange } from "@react-vant/icons";
import { useSelector } from "react-redux";
import { useNavigate } from "react-router-dom";
function Index() {
  const {start,end}=useSelector((state)=>state.CitySlice)
  const navigate=useNavigate()
  const handleToCity=(type)=>{
    navigate(`/city/${type}`)
  }
  return (
    <div>
      <ResultPage status="" title="操作成功" description="九转">
        <Card>
          <div className={styles.home_city}>
            <span onClick={()=>handleToCity("start")}>{start}</span>
            <Exchange />
            <span onClick={()=>handleToCity("end")}>{end}</span>
          </div>

          <div className={styles.home_time}>
            <span>2025-7-29</span>
          </div>

          <div className={styles.home_switch}>
            <Switch></Switch>
            <span>高铁/火车</span>
          </div>
        </Card>
      </ResultPage>
    </div>
  );
}

export default Index;
